package com.spring.annotation.test;

import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
@XmlType(propOrder={"id","name","birthDay","bean","item","map"}) //指定序列成的xml节点顺序
@XmlAccessorType(value=XmlAccessType.FIELD)  //访问类型改为字段
@XmlRootElement
public class Config {
     @XmlAttribute
     private String id;
     @XmlAttribute
     private String name;
     @XmlJavaTypeAdapter(value=DateAdapter.class)
     @XmlElement
     private Date birthDay;
     @XmlElement
     private List<Bean> bean;
     @XmlElement
     private Bean item;
     
     @XmlJavaTypeAdapter(value=MapAdapter.class)
    // @XmlElementWrapper(name="role")
     @XmlElement
     private Map map;
    public String getId() {
        return id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getBirthDay() {
        return birthDay;
    }
    
    
    public void setBirthDay(Date birthDay) {
        this.birthDay = birthDay;
    }

    
  /**
	 * @return the bean
	 */
	public List<Bean> getBean() {
		return bean;
	}

	/**
	 * @param bean the bean to set
	 */
	public void setBean(List<Bean> bean) {
		this.bean = bean;
	}

public Bean getItem() {
    return item;
  }
   public void setItem(Bean item) {
    this.item = item;
   }

  public Map getMap() {
    return map;
  }

  public void setMap(Map map) {
    this.map = map;
 }

@Override
public String toString() {
    return "Config [id=" + id + ", name=" + name
            + ", birthDay=" + birthDay + ", bean=" + bean + ", item="
            + item + ", map=" + map + "]";
}
 
}
